<?php
function lib_shopbuy(&$ctag,&$refObj){
	global $dsql;
	$cfg_ml = new MemberLogin ();
	$html = '<div class="number">数　　量<div><a id="min" class="min" href="javascript:;"></a><b><input id="quantity" type="text" value="1" onblur="changeSum()"/></b><a id="max" href="javascript:;" class="max"></a></div>
			  </div>';
	$html .=  '<a class="join" href="javascript:;">加入购物车</a>';
	if (!$cfg_ml->IsLogin ()) {
		return '<style type="text/css">.sprice{ display:none}</style>';
	}
	$member = $cfg_ml -> fields;
	$rank = $member['rank'];
	$min_rank = 0;
	$is_show = false;
	$res = $dsql->GetOne("SELECT r.rank,c.value FROM `#@__sysconfig` as c left join #@__arcrank  as r on r.id = c.value WHERE c.varname = 'cfg_rank' limit 1 ");
	if (is_array($res) && $res['value'] != 1){
		$min_rank = $res['rank'];
	}
	if(($min_rank && $rank == $min_rank ) || $min_rank == 0){
		$is_show = true;
	}else{
		$is_show = false;
	}
	return $is_show ? $html : '<style type="text/css">.sprice{ display:none}</style>';
}
?>